<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>detail_article</title>
    <link rel="stylesheet" href="./css/public.css">
    <style>
        body{
            background: #F0F3F4;
        }
        .container{
            margin: 25px;
            padding: 10px 25px;
            background: #d7ebf1;
            display: flex;
            border: 1px solid #c0dee7;
            box-shadow: 0 0 4px 1px rgb(149, 200, 216, .5);
        }
        .title{
            line-height: 30px;
            font-size: 18px;
            font-weight: bold;
        }
        .profile_photo{
            padding: 40px;
            height: 0;
            margin-right: 15px;
            background: url(./image/img1.jpg);
            border-radius: 50%;
        }
        .main{
            flex: 1;
            padding-bottom: 40px;
        }
        .time{
            line-height: 3em;
        }
        .body{
            width: 90%;
            padding-left: 20px;
            text-indent: 2em;
        }
    </style>
</head>
<body>
    <div class="container">
        <div class="profile_photo"></div>
        <div class="main">
            <div class="title">标题</div>
            <div class="time">发布时间</div>
            <div class="body"></div>
        </div>
    </div>
    <script src="./node_modules/axios/dist/axios.js"></script>
    <script>
        axios.get('https://ty.php800.cn/api/token.php',{
            headers:{
                TOKEN:localStorage.getItem('token'),
                SAT:'1234567'
            }
        }).then((res)=>{
            console.log(res)
            if(!res.data.verify){
                top.window.location.href='./login.html'
            }
        })
    </script>
    <script>
        function addzero(date){
            return date<10?'0'+date:date
        }
        function $(selector){
            return document.querySelector(selector)
        }
        let {body,datetime,id,title,userid}=JSON.parse(localStorage.thisone)
        let date=new Date(parseInt(datetime))
        date=date.getFullYear()+'年'+addzero(date.getMonth()+1)+'月'+addzero(date.getDate())+'日&nbsp;&nbsp;&nbsp;&nbsp;'+addzero(date.getHours())+':'+addzero(date.getMinutes())+":"+addzero(date.getSeconds())
        $('.title').innerHTML=title
        $('.time').innerHTML=date
        $('.body').innerHTML=body
        axios.get('https://ty.php800.cn/api/member/search.php',{
            params:{
                id:userid
            },
            headers:{
                TOKEN:localStorage.getItem('token'),
                SAT:'1234567'
            }
        }).then((res)=>{
            $('.profile_photo').style.background=`url(${res.data.member[0].useravatar})`
            $('.profile_photo').style.backgroundSize='cover'
            $('.profile_photo').style.backgroundPosition='center'
        })
    </script>
</body>
</html>